//
//  ValueUtils.h
//  CQRCBank_iPhone
//
//  Created by carlos on 12-12-11.
//  Copyright (c) 2012年 magic-point. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, GradeType) {
    GradeTypeGe = 0,
    GradeTypeWan,
    GradeTypeYi
};//枚举：数字级别：整数部分的分级(个级，万级，亿级)

@interface ValueUtils : NSObject
//把金额转换成大写
+(NSString *)getUppercaseBalance:(NSString *)mBalance;
//把日期转换成字符串     yyyy-MM-dd
+(NSString *)getStringByDate:(NSDate *)mDate;
//把日期转换成字符串     yyyyMMdd
+(NSString *)getStringByDate2:(NSDate *)mDate;
//把日期转换成字符串     yyyy-MM
+(NSString *)getStringByDate1:(NSDate *)mDate;
//把yyyy-MM-dd HH:mm:ss 转成 yyyy-MM-dd
+(NSString* )formatDateString3:(NSString* )dateStr;

//把yyyy-MM-dd HH:mm:ss 转成 MM-dd
+(NSString* )formatDateString4:(NSString* )dateStr;

//将yyyyMMdd转换成yyyy年MM月dd日
+(NSString *)getStringByDateString:(NSString *)dateString;
//将yyyyMMdd转换成yyyy.MM.dd
+(NSString *)getStringFromDateString:(NSString *)dateString;
/*
 2013-2-27 added by qinhu
 */
//前1个月的日期
+(NSDate *)previousMonth:(NSDate *)date;
//后1个月的日期
+(NSDate *)nextMonth:(NSDate *)date;
//前3个月的日期
+(NSDate *)threeMonthsAgo:(NSDate *)date;
//后3个月的日期
+(NSDate *)afterThreeMonths:(NSDate *)date;
//格式化日期字符串     yyyyMMdd => yyyy-MM-dd
+(NSString *)formatDateString0:(NSString *)dateStr;
//格式化日期字符串  yyyy-MM-dd => yyyyMMdd
+(NSString *)formatDateString2:(NSString *)dateStr;
//格式化日期字符串  yyyyMM => yyyy-MM
+(NSString *)formatDateString1:(NSString *)dateStr;
//格式化日期字符串     HHmmss => HH:mm:ss
+(NSString *)formatDateString:(NSString *)dateStr;

/*-------本地推送用------*/
//将String，格式yyyyMMdd,转化成date
+(NSDate *)formatWithString:(NSString *)dateString;
//前2天的晚上7点
+(NSDate *)twoDaysAgo:(NSDate *)date;
//前1天得晚上7点
+(NSDate *)previousDay:(NSDate *)date;
//当天早上9点
+(NSDate *)currentDate:(NSDate *)date;
//明天晚上7点
+(NSDate *)nextDay:(NSDate *)date;
//后天晚上7点
+(NSDate *)afterTwoDays:(NSDate *)date;
//大后天晚上7点
+(NSDate *)afterThreeDays:(NSDate *)date;
//后7天晚上7点
+(NSDate *)afterSevenDays:(NSDate *)date;
//两个时间的间隔
+(int)daysForTimeInterval:(NSDate *)oneDate with:(NSDate *)twoDate;
/*---------end---------*/

//验证date1是否大于date2
+(BOOL)date1IsAfterDate2:(NSString *)date1 date2:(NSString *)date2;

+(NSString *)getUrlStringFromString:(NSString *)aStr;

//日期字符串格式化

//根据身份证号码来判断是否成年，年满18岁
+ (BOOL)isAdultWithBirthday:(NSString *)identityCard currentDate:(NSString *)currentDate;

#pragma mark - // 当前日期 格式：yyyyMMdd
+ (NSString *)currentDayStringFormatyyyyMMdd;
+ (NSString *)formatDateStringToyyyyMMdd:(NSDate *)date;

+(BOOL)isConnectNet;

+(NSString *)fillterEight:(NSString *)phoneNumber;

// 生成两位随机数
+ (NSString *)doubleDigitRandomNumbers;

+ (NSString *)showSMSAuthCodeSequenceNumString:(NSString *)seqenceNum andString:(NSString *)string;

#pragma mark -  //获取客户端版本号
+ (NSString *)clientVersion;
#pragma mark -  //判断是否闰年
+ (BOOL) isLeapYear:(int)year;
#pragma mark - 去掉首尾空格
+(NSString *)trim:(NSString *)str;
#pragma mark - 给数字 加 千分符号,保留两位 小数。
+ (NSString *)insertMicrometerSymbolToMoney:(NSString *)money;
#pragma mark - 格式化为以万为单位
+(NSString*) formatAmountByWan:(NSString*) amount;
#pragma mark - rgb
+(UIColor *) stringTOColor:(NSString *)str;
#pragma mark - 判断贷款金额是不是正确
+(BOOL)isRightAmountFormat:(NSNumber*)money;
#pragma mark - // 校验服务器发过来的资料名称是什么类型的
+ (NSString*)whatTypeImage:(NSString *)imageName;

/**
  * 生成一个UUID
 */
+(NSString *)generateUUID;

+ (NSString*) formatDate:(NSString*) orgStrDate InputFormat:(NSString*) inputFormat OutputFormat:(NSString*) outputFormat;
+ (NSString *)intervalSinceNow: (NSString *) theDate;
+ (CGSize) ContentHeight:(NSString*) content ContentSize:(CGSize) contentSize FontSize:(float) fontSize;

@end
